﻿<Window x:Class="Probel.Ldoc.Views.ToolBoxes.CreateDoctorView"
        
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:t="clr-namespace:Probel.Ldoc.Views.Properties"
        xmlns:vm="clr-namespace:Probel.Ldoc.ViewModels.ToolBoxes;assembly=Probel.Ldoc.ViewModels"
        xmlns:ctrl="clr-namespace:Probel.Ldoc.Views.Controls"
        
        Title="{x:Static t:Messages.Title_CreateDoctor}" 
        ResizeMode="NoResize" 
        ShowInTaskbar="False" 
        WindowStartupLocation="CenterOwner" 
        WindowStyle="ToolWindow" 
        SizeToContent="Height"
        Width="400"
        Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Themes/Generic.xaml"/>
                <ResourceDictionary>
                    <Style TargetType="Label">
                        <Setter Property="Width" Value="90"/>
                    </Style>
                    <Style TargetType="TextBlock" x:Key="TextBoxStyle">
                        <Setter Property="Margin" Value="5"/>
                        <Setter Property="FontSize" Value="12"/>
                        <Setter Property="VerticalAlignment" Value="Center"/>
                        <Setter Property="Width" Value="100"/>
                        <Setter Property="TextAlignment" Value="Right"/>
                    </Style>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <DockPanel>
        <TextBlock DockPanel.Dock="Top" Margin="5"
                   Text="{x:Static t:Messages.Title_CreateDoctor}" 
                   FontSize="20" 
                   Foreground="{StaticResource TaskDialogMainInstructionBrush}"/>
        <Border Style="{StaticResource ToolBoxBorderStyle}">
            <StackPanel Orientation="Horizontal"
                        HorizontalAlignment="Right">
                <Button Content="{x:Static t:Messages.Btn_Ok}"
                        Style="{DynamicResource ButtonToolBoxStyle}" 
                        Command="{Binding CreateDoctorCommand}"
                        Click="Click"
                        IsDefault="True"/>
                <Button Content="{x:Static t:Messages.Btn_Cancel}"
                        Style="{DynamicResource ButtonToolBoxStyle}" 
                        Command="{Binding CancelCommand}"
                        Click="Click"
                        IsCancel="True"/>
            </StackPanel>
        </Border>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Label Grid.Row="0" Grid.Column="0"
                   Content="{x:Static t:Messages.Lbl_FirstName}"/>
            <Label Grid.Row="1" Grid.Column="0"
                   Content="{x:Static t:Messages.Lbl_LastName}"/>
            <Label Grid.Row="2" Grid.Column="0"
                   Content="{x:Static t:Messages.Lbl_Specialisation}"/>
            <Label Grid.Row="3" Grid.Column="0"
                   Content="{x:Static t:Messages.Lbl_Phone}"/>


            <GroupBox Header="{x:Static t:Messages.Gb_Address}"
                      Grid.Row="4"
                      Grid.ColumnSpan="2">
                <GroupBox.Resources>
                    <Style TargetType="TextBox">
                        <Setter Property="Margin" Value="5"/>
                    </Style>
                </GroupBox.Resources>
                <StackPanel>
                    <DockPanel DockPanel.Dock="Top">
                        <TextBlock DockPanel.Dock="Left" 
                                   Text="{x:Static t:Messages.Lbl_Street}"
                                   Style="{StaticResource TextBoxStyle}"/>
                        <TextBox DockPanel.Dock="Right" 
                                 Text="{Binding Street, UpdateSourceTrigger=PropertyChanged}"/>
                    </DockPanel>
                    <Grid DockPanel.Dock="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <DockPanel>
                            <TextBlock Text="{x:Static t:Messages.Lbl_StreetNumber}"
                                       Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Text="{Binding StreetNumber, UpdateSourceTrigger=PropertyChanged}"/>
                        </DockPanel>
                        <DockPanel Grid.Column="1">
                            <TextBlock Text="{x:Static t:Messages.Lbl_BoxNumber}" 
                                       Width="Auto"
                                       Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Text="{Binding BoxNumber, UpdateSourceTrigger=PropertyChanged}" />
                        </DockPanel>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <DockPanel>
                            <TextBlock Text="{x:Static t:Messages.Lbl_PostalCode}"
                                                       Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Text="{Binding PostalCode, UpdateSourceTrigger=PropertyChanged}"/>
                        </DockPanel>
                        <DockPanel Grid.Column="1">
                            <TextBlock Text="{x:Static t:Messages.Lbl_City}" Width="Auto"
                                                       Style="{StaticResource TextBoxStyle}"/>
                            <TextBox Text="{Binding City, UpdateSourceTrigger=PropertyChanged}"/>
                        </DockPanel>
                    </Grid>
                </StackPanel>
            </GroupBox>

            <TextBox Grid.Row="0" Grid.Column="1"
                     Margin="5"
                     Text="{Binding FirstName, UpdateSourceTrigger=PropertyChanged}"/>
            <TextBox Grid.Row="1" Grid.Column="1"
                     Margin="5"
                     Text="{Binding LastName, UpdateSourceTrigger=PropertyChanged}"/>
            <DockPanel Grid.Row="2" Grid.Column="1">

                <Button x:Name="addSpecialisationBtn"
                        DockPanel.Dock="Right"
                        Style="{StaticResource EditionButtonStyle}"
                        Click="Click_AddSpecialisation">
                    <Image Source="/Probel.Ldoc.Views;component/Images/Editing/Plus.png"/>
                </Button>
                <Popup x:Name="specialisationPopup"
                       PlacementTarget="{Binding ElementName=addSpecialisationBtn}">
                    <ctrl:TextPopupView x:Name="specialisationContent"/>
                </Popup>
                <ComboBox DockPanel.Dock="Left"
                          ItemsSource="{Binding Specialisations}"
                          DisplayMemberPath="Name"
                          SelectedItem="{Binding SelectedSpecialisation}"
                          SelectedIndex="0"
                          Margin="5"/>
            </DockPanel>
            <TextBox Grid.Row="3" Grid.Column="1"
                     Margin="5"
                     Text="{Binding ProPhone, UpdateSourceTrigger=PropertyChanged}"/>
        </Grid>
    </DockPanel>
</Window>
